//
//  WBNavgationController.swift
//  AdaoWeibo
//
//  Created by 孙道慧 on 2017/3/31.
//  Copyright © 2017年 maihaoche. All rights reserved.
//

import UIKit

class WBNavgationController: UINavigationController {

    // 重写push方法
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        // 初始化根视图的时候也会进行压栈  所以要先判断
        if childViewControllers.count > 0 {
            viewController.hidesBottomBarWhenPushed = true
        }
        super.pushViewController(viewController, animated: true)
    }
}
